﻿// <copyright file="IModOrderingInformation.cs" company="SingularityShift">
// Copyright (c) 2009 SingularityShift.com
// </copyright>
// <author>Ben McClure</author>
// <email>ben@singularityshift.com</email>
// <date>2009-08-14</date>
// <summary>A public interface which defines an object containing information about where a mod should be placed in a load order</summary>
namespace GameLib.Games
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    /// <summary>
    /// Defines a class describing where a mod sits within a list of mods, without knowing what other mods are in the list.
    /// </summary>
    public interface IModOrderingInformation
    {
        /// <summary>
        /// <para>Gets the 0-based index that a mod should be loaded at in the load order</para>
        /// <para>If the mod should have a particular index location, it can be specified here.</para>
        /// <para>It is generally preferred to use the other ordering information and leave the index blank.</para>
        /// <para>The index can be useful for mods which must load first, or at some particular location regardless of where other mods are in the list.</para>
        /// <para>A mod file representing the game itself would generally always be at index 0, for instance.</para>
        /// </summary>
        int Index
        {
            get;
        }

        /// <summary>
        /// <para>Gets a string reference to the group in the list where the mod should be inserted.</para>
        /// <para>If the list supports groups:
        /// - If the group exists, the mod should be placed within the boundaries of that group if possible, while obeying as many other ordering specifications as possible.
        /// - If the group does not exist, it should be created at the most logical position and the mod should be inserted there.</para>
        /// <para>If the list does not support groups, this field is ignored entirely, making it not ideal as a sole descriptor.</para>
        /// </summary>
        string Group
        {
            get;
        }

        /// <summary>
        /// <para>Gets an integer representing a priority for the described mod.</para>
        /// <para>- If this priority is higher than the priority of other mod ordering information, it will take precedence.
        /// - If this priority is lower than the priority of other mod ordering information, it will be discarded and the existing information used.
        /// - If this priority is the same as other mod ordering information (or there is no priority for either), the information will be combined, with things being loaded later taking precedence.</para>
        /// </summary>
        int Priority
        {
            get;
        }

        /// <summary>
        /// Gets a list of mod descriptors (usually Ids or FileNames) that must load before this mod in the list.
        /// </summary>
        IList<string> LoadBefore
        {
            get;
        }

        /// <summary>
        /// Gets a list of mod descriptors (usually Ids or FileNames) that must load after this mod in the list.
        /// </summary>
        IList<string> LoadAfter
        {
            get;
        }
    }
}
